<?php

namespace app\common\service;


class OrderTailNum
{


    
    /*V兔调用 京东商品详情*/
    public static function toolV($goods_id){

        $file_name ="/usr/local/nginx/html/order_assistant/public/uploads/taobao/accessToken.txt";
        $fz = file_exists($file_name);

        if($fz){
            $fp=fopen($file_name,'r');
            while(!feof($fp))
            {
                $buffer=fgets($fp,4096);
            }

            fclose($fp);
        }
        
        $curl = curl_init();
        curl_setopt_array($curl, array(
          CURLOPT_URL => 'http://api.vv-tool.com/tool/accounts/dyiteminfo?itemId='.$goods_id,
          CURLOPT_RETURNTRANSFER => true,
          CURLOPT_ENCODING => '',
          CURLOPT_MAXREDIRS => 10,
          CURLOPT_TIMEOUT => 0,
          CURLOPT_FOLLOWLOCATION => true,
          CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
          CURLOPT_CUSTOMREQUEST => 'GET',
          CURLOPT_HTTPHEADER => array(
            'Authorization: Bearer '.$buffer,
            'Cookie: PHPSESSID=q7om22repophu3ula65ihq92dk; _csrf=9107a318c49bc9378fcc1e47fcc8368ea28ea44c840eb5f6b0ef62d32900458aa%3A2%3A%7Bi%3A0%3Bs%3A5%3A%22_csrf%22%3Bi%3A1%3Bs%3A32%3A%22c5cr8oedpzMahWxuguhIDGg_61fHfnom%22%3B%7D'
          ),
        ));

        $response = curl_exec($curl);

        curl_close($curl);
        //echo $response;

        return $response;
    }

}
